/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.ugc.cnel.manabi.entidades;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Admin
 */
@Entity
@Table(name = "temp_upload", catalog = "", schema = "public")
@NamedQueries({@NamedQuery(name = "TempUpload.findAll", query = "SELECT t FROM TempUpload t"), @NamedQuery(name = "TempUpload.findById", query = "SELECT t FROM TempUpload t WHERE t.id = :id"), @NamedQuery(name = "TempUpload.findBySessionId", query = "SELECT t FROM TempUpload t WHERE t.sessionId = :sessionId"), @NamedQuery(name = "TempUpload.findByNombreArchivo", query = "SELECT t FROM TempUpload t WHERE t.nombreArchivo = :nombreArchivo"), @NamedQuery(name = "TempUpload.findByFechaRegistro", query = "SELECT t FROM TempUpload t WHERE t.fechaRegistro = :fechaRegistro")})
public class TempUpload implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy = GenerationType.SEQUENCE)
    @Column(name = "id", nullable = false)
    private Integer id;
    @Basic(optional = false)
    @Column(name = "session_id", nullable = false, length = 500)
    private String sessionId;
    @Basic(optional = false)
    @Column(name = "nombre_archivo", nullable = false, length = 400)
    private String nombreArchivo;
    @Basic(optional = false)
    @Column(name = "fecha_registro", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechaRegistro;
    @Basic(optional = false)
    @Column(name = "ruta", nullable = false, length=800)
    private String ruta;

    public TempUpload() {
    }

    public TempUpload(Integer id) {
        this.id = id;
    }

    public TempUpload(Integer id, String sessionId, String nombreArchivo, Date fechaRegistro,String ruta) {
        this.id = id;
        this.sessionId = sessionId;
        this.nombreArchivo = nombreArchivo;
        this.fechaRegistro = fechaRegistro;
        this.ruta=ruta;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public String getNombreArchivo() {
        return nombreArchivo;
    }

    public void setNombreArchivo(String nombreArchivo) {
        this.nombreArchivo = nombreArchivo;
    }

    public Date getFechaRegistro() {
        return fechaRegistro;
    }

    public void setFechaRegistro(Date fechaRegistro) {
        this.fechaRegistro = fechaRegistro;
    }

    public String getRuta() {
        return ruta;
    }

    public void setRuta(String ruta) {
        this.ruta = ruta;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TempUpload)) {
            return false;
        }
        TempUpload other = (TempUpload) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.ugc.cnel.manabi.entidades.TempUpload[id=" + id + "]";
    }
}
